/*

SA-MP Data Recorder
This script is a utility made to record client values. The recordings can be played back to fingerprint cheats and hacks.

Copyright (c) 2012, Quiet Whistler

*/

// ===================================
//
// Plugin includes
//
// ===================================
#include <a_samp> 			// Credits: SA-MP
#include <streamer> 		// Credits: Incognito
#include <foreach> 			// Credits: Y_less
#include <mapandreas> 		// Credits: Kalcor
#include <sscanf2> 			// Credits: Y_less
#include <zcmd> 			// Credits: Zeex
#include <geolocation>		// Credits: whitetigerswt
#include <a_zones>			// Credits: ~Cueball~

// ===================================
//
// Server configuration
//
// =================================== 
#define SERVER_VERSION 			"0.1" 					// Defined globally to use in game

// ===================================
//
// Colors
//
// =================================== 
#define COLOR_WHITE 		0xFFFFFFFF // Normal chat texts
#define COLOR_GREY 			0xAFAFAFAA // Subtle texts and command usage information
#define COLOR_GREEN 		0x9EC73DAA // Success messages
#define COLOR_RED 			0xAA3333AA // Errors
#define COLOR_ORANGE 		0xFF9900AA // Suspects
#define COLOR_PINK 			0xFF66FFAA // Reserved for certain jobs
#define COLOR_DARKRED 		0x660000AA // UNUSED
#define COLOR_BRIGHTRED 	0xFF0000AA // OLD punishment messages
#define COLOR_BLUE 			0xABCDEF01 // Police and admin actions and notifications
#define COLOR_LIGHTCYAN 	0xAAFFCC33 // UNUSED
#define COLOR_LEMON 		0xDDDD2357 // PM's
#define COLOR_LIGHTRED 		0xFF6347AA // UNUSED
#define COLOR_LIGHTBLUE 	0x33CCFFAA // Admin messages and notifications
#define COLOR_LIGHTGREEN 	0x9ACD32AA // UNUSED
#define COLOR_YELLOW 		0xDABB3EAA // Messages from server to player
#define COLOR_YELLOW2 		0xF5DEB3AA // /me, say and /em
#define COLOR_BRIGHTRED2	0xFF0000FF // NEW punishment messages
#define COLOR_SAPD			0x0066FFAA // SAPD
#define COLOR_BLACK			0x000000AA // Black, just black
#define COLOR_RPG			0xCC99FFAA // RPG Pinkish

// ===================================
//
// Vehicle names
//
// =================================== 
new VehicleNames[212][] = {
{"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
{"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
{"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
{"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
{"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
{"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
{"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
{"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
{"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
{"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
{"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
{"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"Rancher"},{"Virgo"},{"Greenwood"},
{"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
{"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
{"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
{"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
{"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
{"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
{"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
{"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
{"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
{"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
{"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
{"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
{"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"SWAT Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
{"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
{"Utility Trailer"}
};

// ===================================
//
// Death reasons
//
// =================================== 
new DeathReason[256][] = {	
	{"Fists"},
	{"Brass Knuckles"},
	{"Golf Club"},
	{"Nite Stick"},
	{"Knife"},
	{"Baseball Bat"},
	{"Shovel"},
	{"Pool Cue"},
	{"Katana"},
	{"Chainsaw"},
	{"Purple Dildo"},
	{"Small Whit Vibrator"},
	{"Large White Vibrator"},
	{"Silver Vibrator"},
	{"Flowers"},
	{"Cane"},
	{"Grenade"},
	{"Tear Gas"},
	{"Molotov Cocktail"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"9mm"},
	{"Silenced 9mm"},
	{"Desert Eagle"}, 
	{"Shotgun"},
	{"Sawn-off Shotgun"},
	{"Combat Shotgun"},
	{"Micro SMG"},
	{"MP5"},
	{"AK-47"},
	{"M4"},
	{"Tec9"},
	{"Country Rifle"},
	{"Sniper Rifle"},
	{"Rocket Launcher"},
	{"Heat Seeking Rocket Launcher"},
	{"Flamethrower"},
	{"Minigun"},
	{"Satchel Charge"},
	{"Detonator"},
	{"Spraycan"},
	{"Fire Extinguisher"},
	{"Camera"},
	{"Nightvision Goggles"},
	{"Thermal Goggles"},
	{"Parachute"},
	{"Fake Pistol"},
	{"Invalid"},
	{"Vehicle"},
	{"Helicopter Blades"},
	{"Explosion"},
	{"Invalid"},
	{"Drowned"},
	{"Fall"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Connect"},
	{"Disconnect"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Invalid"},
	{"Vehicle/Rocket Explosion"}
};

// ===================================
//
// Script entry point
// 
// ===================================

main()
{
	print("\n----------------------------------");
	print("       SA-MP Data Recorder\n");
	print("      Copyright(c) 2010-2012   \n");
	print("----------------------------------\n");
}

// ===================================
//
// Callbacks
//
// =================================== 
public OnGameModeInit()
{
	// ///////////////////////////////////////// //
	// All functions loaded when the server starts
	// ///////////////////////////////////////// //
	
	// Create variable for the gamemodetext
	new gamemodetext[64];
	
	// Format the variable (SERVER_VERSION is set in the CVA)
	format(gamemodetext,sizeof(gamemodetext),"sampDR v%s", SERVER_VERSION);
	
	// Set the variable as gamemodetext
	SetGameModeText(gamemodetext);
	
	// Player markers will be shown on the mini-map
	ShowPlayerMarkers(1);
	
	// You will only see them in a 100 float range
	LimitPlayerMarkerRadius(100.0);
	
	// Player name tags will be shown
	ShowNameTags(1);
	
	// Limit the radius of the nametags
	SetNameTagDrawDistance(50.0);
	
	// Disable the default interiors at LSPD ect.
	DisableInteriorEnterExits();
	
	// Disable the stunt bonus due to anti cheating
	EnableStuntBonusForAll(0);
	
	// Disable normal vehicle behavior
	ManualVehicleEngineAndLights();
	
	AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
    AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
	
	
	
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerConnect(playerid)
{
	SetPlayerWorldBounds(playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	
	return 1;
}

public OnPlayerSpawn(playerid)
{
		
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	// When the state of a player changes, such as driver or on foot.
	// Needed in the vehicle script and for the Anti-cheating module.
	return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	// Log failed attempts here
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	
	return 1;
}

public OnPlayerText(playerid, text[])
{
	
	return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    
	return 1;
}